<template>
	<view class="">
		<view class="topbox">
			<!-- <u-navbar :is-back="false" title-color="#ffffff" title-size="36" :background="background"
				:border-bottom="false">
			</u-navbar> -->
			<view class="souosbox">
				<text class="city">成都</text>
				<text class="angle"></text>
				<view class="inputbox" @click="search">
					<image src="../../static/image/搜索.png" mode="" class="sousuo"></image>
					<input type="text" value="" placeholder="快来搜索好物吧~" />
				</view>
				<view class="infobox" @click="message">
					<image src="../../static/消息.png" mode=""></image>
					<text class="dian"></text>
				</view>
			</view>
		</view>

		<!-- 轮播图 -->
		<view class="wrap">
			<u-swiper :list="list" mode="dot" :height="320"></u-swiper>
		</view>

		<!-- 咨询公告 -->
		<view class="zxggbox">
			<image src="../../static/zxgg.png" mode=""></image>
			<!-- 滚动通知 -->
			<u-notice-bar mode="horizontal" :list="lists" type="none"></u-notice-bar>
		</view>

		<!-- 每日签到 -->
		<view class="ggbox">
			<view class="smallbox" v-for="(item,index) in gglist" :key="index" @click="sign(item)">
				<image :src="item.img" mode=""></image>
				<view class="title">
					{{item.text}}
				</view>
			</view>
		</view>

		<!-- 广告 -->
		<view class="adbox">
			<image src="../../static/ad.png" mode="widthFix"></image>
		</view>

		<!-- 热门推荐 -->
		<view class="rmbox">
			<image src="../../static/rmtj.png" mode="widthFix"></image>
		</view>

		<Baseproduct @particulars="particulars"></Baseproduct>

		<!-- 猜你喜欢 -->
		<view class="rmbox">
			<image src="../../static/cainixihuan.png" mode="widthFix"></image>
		</view>
		<!-- 筛选 -->
		<view class="sxbox">
			<view :class="current==index?'selecttitle':'title'" v-for="(item,index) in guesslist" :key="index"
				@click="screen(index)">
				{{item}}
			</view>
		</view>
		<Baselistproduct></Baselistproduct>
	</view>


</template>

<script>
	import Baseproduct from "../../components/Baseproduct/index.vue"
	import Baselistproduct from "../../components/Baselistproduct/index.vue"
	export default {
		data() {
			return {
				// 头部背景图
				background: {
					background: 'https://cdn.uviewui.com/uview/swiper/1.jpg'
				},
				// 轮播图
				list: [{
						image: 'https://cdn.uviewui.com/uview/swiper/1.jpg'
					},
					{
						image: 'https://cdn.uviewui.com/uview/swiper/2.jpg'
					},
					{
						image: 'https://cdn.uviewui.com/uview/swiper/3.jpg'
					}
				],
				lists: [
					'寒雨连江夜入吴',
					'平明送客楚山孤',
					'洛阳亲友如相问',
					'一片冰心在玉壶'
				],
				gglist: [{
					img: "../../static/qiandao.png",
					text: "每日签到",
					url:"/pagesB/sign/index"
				}, {
					img: "../../static/image/70_抽奖.png",
					text: "幸运抽奖",
					url:"/pagesB/draw/index"
				}, {
					img: "../../static/image/邀请-色块icon.png",
					text: "邀请有奖"
				}, {
					img: "../../static/image/商务合作.png",
					text: "商务合作",
					url:"/pages/business/index"
				}],

				// 猜你喜欢的筛选
				guesslist: ["猜你喜欢", "商品推荐", "无需预约", "即将下架"],
				current: 0
			}
		},
		methods: {
			screen(v) {
				this.current = v
			},
			// 商品详情
			particulars(){
				this.jumpLink({link:"/pages/Product_Particulars/index"})
			},
			// 信息
			message(){
				this.jumpLink({link:"/pages/message/index"})
			},
			sign(v){
				// console.log(v.url)
				this.jumpLink({link:v.url})
			},
			// 搜索
			search(){
				this.jumpLink({link:"/pagesB/search/index"})
			}
		},
		onLoad() {

		},
		onShow() {},
		components: {
			Baseproduct,
			Baselistproduct
		}
	}
</script>

<style scoped lang="scss">
	.topbox {
		height: 334rpx;
		// background: url(https://cdn.uviewui.com/uview/swiper/1.jpg) no-repeat fixed top;
		background: url("../../static/bj.png") no-repeat fixed top;
		background-size: 100% 334rpx;
		padding-top: 75rpx;
		box-sizing: border-box;

		.souosbox {
			display: flex;
			align-items: center;

			.city {
				font-family: MicrosoftYaHei;
				font-size: 26rpx;
				font-weight: normal;
				color: #ffffff;
				margin-left: 25rpx;
			}

			.angle {
				border: 14rpx solid transparent;
				border-top: 18rpx solid #fff;
				width: 0;
				height: 0px;
				margin-left: 10rpx;
				margin-top: 20rpx;
			}

			.inputbox {
				width: 564rpx;
				height: 68rpx;
				background-color: #ffffff;
				border-radius: 34rpx;
				display: flex;
				align-items: center;
				padding-left: 30rpx;
				padding-right: 20rpx;
				box-sizing: border-box;
				margin-left: 10rpx;

				.sousuo {
					width: 26rpx;
					height: 27rpx;
				}

				input {
					margin-left: 15rpx;
					font-family: PingFang-SC-Medium;
					font-size: 24rpx;
					width: 450rpx;
					height: 40rpx;
				}
			}

			.infobox {
				width: 32rpx;
				height: 34rpx;
				margin-left: 10rpx;
				position: relative;

				image {
					width: 32rpx;
					height: 34rpx;
				}

				.dian {
					position: absolute;
					width: 2rpx;
					height: 2rpx;
					border-radius: 2rpx;
					background-color: #ff0000;
					top: 0;
					right: 0;
				}
			}
		}
	}

	// 轮播图
	.wrap {
		width: 700rpx;
		height: 320rpx;
		border-radius: 12rpx;
		margin-left: 25rpx;
		margin-top: -160rpx;
	}

	// 咨询公告
	.zxggbox {
		width: 700rpx;
		height: 54rpx;
		background-color: #ffffff;
		border-radius: 12rpx;
		display: flex;
		align-items: center;
		margin-left: 25rpx;
		margin-top: 10rpx;
		padding-left: 16rpx;
		padding-right: 10rpx;
		box-sizing: border-box;

		image {
			width: 106rpx;
			height: 27rpx;
		}
	}

	//签到
	.ggbox {
		display: flex;
		align-items: center;
		justify-content: space-around;
		margin-top: 28rpx;

		.smallbox {
			image {
				width: 82rpx;
				height: 82rpx;
				margin: 0 auto;
				display: block;
			}

			.title {
				text-align: center;
				font-family: MicrosoftYaHei;
				font-size: 26rpx;
				color: #444444;
				margin-top: 20rpx;
			}
		}
	}

	// 广告
	.adbox {
		width: 700rpx;
		height: 220rpx;
		margin-left: 25rpx;
		border-radius: 10rpx;
		margin-top: 32rpx;

		image {
			width: 700rpx;
		}
	}

	.rmbox {
		margin-left: 25rpx;
		margin-top: 35rpx;

		image {
			width: 165rpx;
		}
	}



	.sxbox {
		display: flex;
		align-items: center;
		justify-content: space-around;
		margin-top: 10rpx;

		.title {
			width: 164rpx;
			height: 56rpx;
			background-color: #ffffff;
			border-radius: 10rpx;
			line-height: 56rpx;
			text-align: center;
			font-family: MicrosoftYaHei;
			font-size: 26rpx;
			color: #666666;
		}

		.selecttitle {
			width: 164rpx;
			height: 56rpx;
			background-color: #ffffff;
			border-radius: 10rpx;
			line-height: 56rpx;
			text-align: center;
			font-family: MicrosoftYaHei;
			font-size: 26rpx;
			color: #fb5e24;
		}
	}
</style>
